home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 25 / CU Amiga Magazine's Super CD-ROM 25 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-08].iso / CUCD / Programming / GMS / GMSDev / EModules / gms / dpkernel / dpkernel.e next >
Encoding:
Text File  |  1998-04-12  |  5.2 KB  |  149 lines

  1. /*
  2. **  $VER: dpkernel.e V1.0
  3. **
  4. **  General include file for programs using the DPKernel.
  5. **
  6. **  (C) Copyright 1996-1998 DreamWorld Productions.
  7. **      All Rights Reserved
  8. */
  9.  
  10. OPT MODULE
  11. OPT EXPORT
  12. OPT PREPROCESS
  13.  
  14. MODULE 'gms/system/register'
  15.  
  16. CONST DPKVersion  = 1,
  17.       DPKRevision = 0
  18.  
  19. CONST SKIPENTRY  = 0,
  20.       ENDLIST    = -1,
  21.       LISTEND    = -1,
  22.       TAGEND     = 0
  23.  
  24. CONST TBYTE    = $00000000,
  25.       TLONG    = $80000000,
  26.       TWORD    = $40000000,
  27.       TAPTR    = $C0000000,
  28.       TSTEPIN  = $10000000,
  29.       TSTEPOUT = $08000000,
  30.       TTRIGGER = $04000000
  31.  
  32. CONST TAG_IGNORE = 1,
  33.       TAG_MORE   = 2,
  34.       TAG_SKIP   = 3
  35.  
  36. CONST GET_NOTRACK = $00010000,
  37.       GET_PUBLIC  = $00020000,
  38.       GET_SHARE   = $00060000
  39.  
  40. /***************************************************************************
  41. ** Header used for all objects.
  42. */
  43.  
  44. OBJECT head
  45.   id      :INT
  46.   version :INT
  47.   class   :LONG ->PTR TO sysobject
  48.   stats   :LONG ->PTR TO stats
  49. ENDOBJECT
  50.  
  51. /****************************************************************************
  52. ** The Stats structure is private to the system, and is handled by Get()
  53. */
  54.  
  55. OBJECT stats
  56.   key          :LONG       /* Resource tracking key */
  57.   childprivate :LONG       /* Reserved pointer for use by child objects */
  58.   flags        :LONG       /* General flags */
  59.   exclusive    :LONG       /* Who owns the exclusive */
  60.   lockcount    :INT        /* A running count of active locks */
  61.   emp          :INT        /* */
  62.   memflags     :LONG       /* Recommended memory allocation flags */
  63. ENDOBJECT
  64.  
  65. CONST ST_SHARED      = $00000001,  /* The object is being openly shared */
  66.       ST_EXCLUSIVE   = $00000002,  /* If the object is exclusive to a task */
  67.       ST_PUBLIC      = $00000004,  /* If the object can be passed around */
  68.       ST_NOTRACKING  = $00000008,  /* Do not track resources on this object */
  69.       ST_INITIALISED = $00000010   /* This is set by Init() */
  70.  
  71. /****************************************************************************
  72. ** Raw Data object.
  73. */
  74.  
  75. CONST VER_RAWDATA  = 1,
  76.       TAGS_RAWDATA = $FFFB0000 OR ID_RAWDATA
  77.  
  78. OBJECT rawdata
  79.   head[1] :ARRAY OF head   /* Standard structure header */
  80.   size    :LONG            /* Size of the data in bytes */
  81.   data    :PTR TO CHAR     /* Pointer to the data */
  82. ENDOBJECT
  83.  
  84. /****************************************************************************
  85. ** ItemList object.
  86. */
  87.  
  88. CONST VER_ITEMLIST  = 1,
  89.       TAGS_ITEMLIST = $FFFB0000 OR ID_ITEMLIST
  90.  
  91. OBJECT itemlist
  92.   head[1] :ARRAY OF head /* Standard header */
  93.   array   :LONG          /* Pointer to the list's array, terminated with -1 */
  94.   maxsize :LONG          /* Maximum amount of objects that this list can hold */
  95. ENDOBJECT
  96.  
  97. /***************************************************************************
  98. ** Universal errorcodes returned by certain functions.
  99. */
  100.  
  101. ENUM  ERR_OK,          /* Function went OK */
  102.       ERR_NOMEM,       /* Not enough memory available */
  103.       ERR_NOPTR,       /* Required pointer not present */
  104.       ERR_INUSE,       /* Previous allocations have not been freed */
  105.       ERR_STRUCT,      /* Structure version not supported or not found */
  106.       ERR_FAILED,      /* General failure */
  107.       ERR_FILE,        /* File error, eg file not found */
  108.       ERR_DATA,        /* There is an error in the given data */
  109.       ERR_SEARCH,      /* A search routine failed to make a match */
  110.       ERR_SCRTYPE,     /* Screen Type not recognised */
  111.       ERR_MODULE,      /* Trouble with initialising/using a module */
  112.       ERR_RASTCOMMAND, /* Invalid raster command detected */
  113.       ERR_RASTERLIST,  /* Complete rasterlist failure */
  114.       ERR_NORASTER,    /* Rasterlist missing from Screen->RasterList */
  115.       ERR_DISKFULL,    /* Disk full error */
  116.       ERR_FILEMISSING, /* File not found */
  117.       ERR_WRONGVER,    /* Wrong version or version not supported */
  118.       ERR_MONITOR,     /* Monitor driver not found or cannot be used */
  119.       ERR_UNPACK,      /* Problem with unpacking of data */
  120.       ERR_ARGS,        /* Invalid arguments passed to function */
  121.       ERR_NODATA,      /* No data is available for use */
  122.       ERR_READ,        /* Error reading data from file */
  123.       ERR_WRITE,       /* Error writing data to file */
  124.       ERR_LOCK,        /* Could not obtain lock on object */
  125.       ERR_EXAMINE,     /* Could not examine directory or file */
  126.       ERR_LOSTCLASS,   /* This object has lost its class reference */
  127.       ERR_NOACTION,    /* This object does not support the required action */
  128.       ERR_NOSUPPORT,   /* Object does not support the given data */
  129.       ERR_MEMORY,      /* General memory error */
  130.       ERR_TIMEOUT,     /* Function timed-out before successful completion */
  131.       ERR_NOSTATS      /* This object has lost its stats structure */
  132.  
  133. CONST ERR_SUCCESS = 0  /* Synonym for ERR_OK */
  134.  
  135. /***************************************************************************
  136. ** Memory types used by AllocMemBlock().  This is generally identical to the
  137. ** exec definitions but CHIP is renamed to VIDEO (displayable memory) and
  138. ** there is an addition of BLIT and SOUND specific memory.
  139. */
  140.  
  141. CONST MEM_DATA      = $00000000,
  142.       MEM_PUBLIC    = $00000001,
  143.       MEM_VIDEO     = $00000002,
  144.       MEM_BLIT      = $00000004,
  145.       MEM_SOUND     = $00000008,
  146.       MEM_CODE      = $00000010,
  147.       MEM_UNTRACKED = $80000000
  148.  
  149.